import request from '@/utils/request'
// 获取员工简单列表
export const getEmployeesSimple = () => request.get('/sys/user/simple')
// 获取员工列表
export const getEmployeeList = params => request.get('/sys/user', {
  params
})
// 删除员工
export function delEmployee(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
// 新增员工
export const addEmployees = data => request.post('/sys/user', data)
// 批量导入员工
export const importEmployees = data => request.post('/sys/user/batch', data)
// 获取员工详细信息
export const getEmployeeDetail = id => request.get(`/employees/${id}/personalInfo`)
// 保存员工详细信息
export const saveEmployeeDetail = data => request.put(`/employees/${data.userId}/personalInfo`, data)
// 获取员工岗位信息
export const getJobDetail = id => request.get(`/employees/${id}/jobs`)
// 保存员工岗位信息
export const saveJobDetail = data => request.put(`/employees/${data.userId}/jobs`, data)
// 给员工分配角色 /sys/user/assignRoles
export const assignRoles = data => request.put('/sys/user/assignRoles', data)
